import request from "@/utils/request";
import { BannerQuery, BannerPageResult, BannerForm, Banner } from "./model";

/**
 * 大图分类API
 */
class BannerAPI {

  /**
   * 大图分类分页数据
   * @param queryParams 
   * @returns 
   */
  static getPage(queryParams?: BannerQuery) {
    return request<any, BannerPageResult>({
      url:
        "/banner/getPage?currentPage=" +
        queryParams?.pageNum +
        "&size=" +
        queryParams?.pageSize,
      method: "post",
      data: queryParams,
    });
  }

  /**
   * 获取大图分类列表
   * @param data 
   * @returns 
   */
  static getList(data: BannerQuery) {
    return request<any, Banner[]>({
      url: "/banner/getList",
      method: "post",
      data: data,
    });
  }


  /**
   * 新增大图分类
   * @param data 
   * @returns 
   */
  static add(data: BannerForm) {
    return request({
      url: "/banner/add",
      method: "post",
      data: data,
    });
  }
  /**
   * 修改大图分类
   * @param data 
   * @returns 
   */
  static update(data: BannerForm) {
    return request({
      url: "/banner/edit",
      method: "post",
      data: data,
    });
  }

  /**
   * 删除大图分类
   * @param data 
   * @returns 
   */
  static delete(data: BannerForm) {
    return request({
      url: "/banner/delete",
      method: "post",
      data: data,
    });
  }
}

export default BannerAPI;
